package com.aspose.cells;

abstract class zaby {
   static double a(double[] var0, int var1, double[] var2, int var3, double var4) {
      double var8 = var0[var1 - 1];

      for(int var6 = var1 - 1; var6 > 0; --var6) {
         var8 = var4 * var8 + var0[var6 - 1];
      }

      double var10 = var2[var3 - 1];

      for(int var7 = var3 - 1; var7 > 0; --var7) {
         var10 = var4 * var10 + var2[var7 - 1];
      }

      return var8 / var10;
   }

   static double a(double var0) {
      double[] var2 = new double[]{3.3871328727963665D, 133.14166789178438D, 1971.5909503065513D, 13731.69376550946D, 45921.95393154987D, 67265.7709270087D, 33430.57558358813D, 2509.0809287301227D};
      double[] var3 = new double[]{1.0D, 42.31333070160091D, 687.1870074920579D, 5394.196021424751D, 21213.794301586597D, 39307.89580009271D, 28729.085735721943D, 5226.495278852854D};
      return var0 * a(var2, 8, var3, 8, 0.180625D - var0 * var0);
   }

   static double b(double var0) {
      double[] var2 = new double[]{1.4234371107496835D, 4.630337846156546D, 5.769497221460691D, 3.6478483247632045D, 1.2704582524523684D, 0.2417807251774506D, 0.022723844989269184D, 7.745450142783414E-4D};
      double[] var3 = new double[]{1.0D, 2.053191626637759D, 1.6763848301838038D, 0.6897673349851D, 0.14810397642748008D, 0.015198666563616457D, 5.475938084995345E-4D, 1.0507500716444169E-9D};
      return a(var2, 8, var3, 8, var0 - 1.6D);
   }

   static double c(double var0) {
      double[] var2 = new double[]{6.657904643501103D, 5.463784911164114D, 1.7848265399172913D, 0.29656057182850487D, 0.026532189526576124D, 0.0012426609473880784D, 2.7115555687434876E-5D, 2.0103343992922881E-7D};
      double[] var3 = new double[]{1.0D, 0.599832206555888D, 0.1369298809227358D, 0.014875361290850615D, 7.868691311456133E-4D, 1.8463183175100548E-5D, 1.421511758316446E-7D, 2.0442631033899397E-15D};
      return a(var2, 8, var3, 8, var0 - 5.0D);
   }

   public static double d(double var0) {
      if (var0 == 1.0D) {
         return 100000.0D;
      } else if (var0 == 0.0D) {
         return -100000.0D;
      } else {
         double var2 = var0 - 0.5D;
         if (Math.abs(var2) <= 0.425D) {
            return a(var2);
         } else {
            double var6 = var0 < 0.5D ? var0 : 1.0D - var0;
            double var4 = Math.sqrt(-Math.log(var6));
            double var8;
            if (var4 <= 5.0D) {
               var8 = b(var4);
            } else {
               var8 = c(var4);
            }

            return var0 < 0.5D ? -var8 : var8;
         }
      }
   }
}
